<script setup>
  import { onMounted } from 'vue'

  onMounted(() => {
    // 创建节点查询器
    const selectorQuery = uni.createSelectorQuery()
    selectorQuery.select('.box').boundingClientRect((info) => {
      console.log(`盒子宽度:${info.width}px,盒子宽度:${info.height}px`)
    })
    selectorQuery.selectAll('.box').boundingClientRect((rect) => {
      console.log('节点信息', rect)
    })
    selectorQuery.selectViewport().scrollOffset((offset) => {
      console.log('', offset)
    })
    selectorQuery.exec()
  })
</script>

<template>
  <view class="box">盒子</view>
  <view class="box"> 类选择器名称一样的另一个盒子 </view>
  <custom-tabs></custom-tabs>
  <custom-form></custom-form>
</template>

<style>
  .box {
    width: 300rpx;
    height: 300rpx;
    background-color: aquamarine;
  }
</style>
